package gestion.camping.dto;

import gestion.camping.utils.DateFormatUtils;

import java.util.Date;
import java.util.List;


public class ReservationPdf extends Reservation {
	
	private List<Personne> listOccupant;
	private List<Visiteur> listVisiteur;
	private int montantFraisResa;
	private Double montantTotalSejour;
		
	public ReservationPdf(){
		super();
	}

	public ReservationPdf(long id, Personne client, Emplacement emplacement,
			StatutReservation statut, Carte carte, TypeLocation typeLocation,
			Badge badge, Date dateDebut, Date dateFin, boolean ARRHE,
			boolean FraisResa, double montant, List<Personne> listOccupant,
			List<Visiteur> listVisiteur, int montantFraisResa,
			 Double montantTotalSejour) {
		
		super(id, client, emplacement, statut, carte, typeLocation, badge, dateDebut,
				dateFin, ARRHE, FraisResa, montant);
				
		this.listOccupant = listOccupant;
		this.listVisiteur = listVisiteur;
		this.montantFraisResa = montantFraisResa;
		this.montantTotalSejour = montantTotalSejour;
	}

	public ReservationPdf(Reservation reservation) {
		super(reservation.getId(), reservation.getClient(), reservation.getEmplacement(), reservation.getStatut(),
				reservation.getCarte(), reservation.getTypeLocation(), reservation.getBadge(), reservation.getDateDebut(),
				reservation.getDateFin(), reservation.getARRHE(), reservation.getFraisResa(), reservation.getMontant());
	}

	public List<Personne> getListOccupant() {
		return listOccupant;
	}

	public void setListOccupant(List<Personne> listOccupant) {
		this.listOccupant = listOccupant;
	}

	public List<Visiteur> getListVisiteur() {
		return listVisiteur;
	}

	public void setListVisiteur(List<Visiteur> listVisiteur) {
		this.listVisiteur = listVisiteur;
	}

	public int getMontantFraisResa() {
		return montantFraisResa;
	}

	public void setMontantFraisResa(int montantFraisResa) {
		this.montantFraisResa = montantFraisResa;
	}

	public Double getMontantTotalSejour() {
		return montantTotalSejour;
	}

	public void setMontantTotalSejour(Double montantTotalSejour) {
		this.montantTotalSejour = montantTotalSejour;
	}
	
	public Double getNombreJour(){
		return DateFormatUtils.getDaysBetweenDates(getDateDebut(), getDateFin());
	}
	
	public Double getArrhesFraisResa(){
		return getMontantTotalSejour() - getMontant() + montantFraisResa;
	}
	
	public String getDateJour(){
		String format = "dd/MM/yyyy"; 

		java.text.SimpleDateFormat formater = new java.text.SimpleDateFormat( format ); 
		java.util.Date date = new java.util.Date(); 
		
		return formater.format( date );
	}
	
	public Double getTotal(){
		return montantTotalSejour + montantFraisResa;
	}
	
	public int getNombreVisiteur(){
		return listVisiteur.size();
	}
	
	public int getNombreOccupant(){
		return listOccupant.size();
	}

}
